package basic.thread.again;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * 线程池
 *
 * @author bingo
 * @create 2018-02-12 19:58
 **/
public class Demo4 {


    public static void main(String[] args) {
        ExecutorService pool = Executors.newCachedThreadPool();

        for(int i=0;i<1000;i++){
            pool.execute(new Runnable() {
                @Override
                public void run() {
                    System.out.println(Thread.currentThread().getName());
                }
            });
        }

    }



}
